package ipt.capitulo19;
import java.io.*;
import javax.swing.*;
import java.net.* ;
public class LeeFicheroURL{
   void leeFicheroURL(URL url, JTextArea aTexto){ 
    String texto="";
	aTexto.setText(null);
	try{
	  InputStream fis = url.openStream() ;
	  Reader sRead = new BufferedReader(
	              new InputStreamReader(fis));
      BufferedReader fE=new BufferedReader(sRead);
	  while(texto != null){
	     texto = fE.readLine();
         aTexto.append(texto+'\n');
  	  }
	  fE.close();
    }catch(IOException e){
      System.out.println("Error en el fichero");
	}
  }
}
